<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<table border="0" style="border-spacing: 0px;">
<%! int i =0; %>
	<tr>
	<th>
		Place
	</th>
	<th>
		Nom
	</th>
	<th>
		Prenom
	</th>
	
	<th>
		Categorie
	</th>
	<th>
		NouvelHandicap
	</th>
		<c:forEach items="${listShootOfTheYear}" var="shootDay"  >
				
			<fmt:formatDate var="month" value="${shootDay.date}" pattern="MM" />
			<fmt:formatDate var="day" value="${shootDay.date}" pattern="dd" />
			<th colspan="3" >
				${shootDay.location}<br/>${day}/${month}
			</th>
		</c:forEach>
	</tr>
	<c:forEach items="${list }" var="perso">
		<tr>
			<c:choose>
			<c:when test="${perso.first}">
				<td bgcolor="#339933">
					<c:if test="${perso.person.getTotalRanking(year)>0}">${perso.person.getTotalRanking(year)}</c:if> 
				</td>
			</c:when>
			<c:otherwise>
			<td>
				<c:if test="${perso.person.getTotalRanking(year)>0}">${perso.person.getTotalRanking(year)}</c:if> 
			</td>
			</c:otherwise>
			</c:choose>
			
			<td>
				${perso.person.name} 
			</td>
			<td>
				${perso.person.forName} 
			</td>
			
			<td>
				${perso.person.getLastHandicap( year).categorie} 
			</td>
			<td>
				<fmt:formatNumber var="oldH" type="number"  maxFractionDigits="2" minFractionDigits="0" value="${perso.person.getLastHandicap( year).previousHandicap}" />
				${oldH}
				>
				<fmt:formatNumber var="currentH" type="number"  maxFractionDigits="2" minFractionDigits="0" value="${perso.person.getLastHandicap( year).currentHandicap}" />
				${currentH}
			</td>
				<c:forEach items="${listShootOfTheYear}" var="shootDay"  >
				
					<td >
						<fmt:formatNumber var="realValue" type="number"  maxFractionDigits="2" minFractionDigits="0" value="${perso.person.getResultFor(shootDay).realValue}" />
						<c:if test="${realValue !='0'}">${realValue}</c:if> 
					</td>
					<td >
					<fmt:formatNumber var="evolution" type="number"  maxFractionDigits="2" minFractionDigits="2" value="${perso.person.getResultFor(shootDay).evolution}" />
						<c:if test="${evolution !='0,00'}">${evolution}</c:if> 
					</td>
					<td style="">
					<fmt:formatNumber var="nouvelHandicap" type="number"  maxFractionDigits="2" minFractionDigits="2" value="${perso.person.getResultFor(shootDay).percentNewHandicap}" />
					<c:if test="${nouvelHandicap !='0,00'}">${nouvelHandicap}</c:if> 
					</td>
				</c:forEach>
			
		</tr>
	</c:forEach>
			
</table>
</body>
</html>